﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace GraphViewer.Configuration
{
    public class ProcessConfigurationElement : BaseConfigurationElement
    {
        [ConfigurationProperty("groupId", IsRequired = true)]
        public string GroupId
        {
            get
            {
                return (string)this["groupId"];
            }
            set
            {
                this["groupId"] = value;
            }
        }

        [ConfigurationProperty("groupName", IsRequired = false)]
        public string GroupName
        {
            get
            {
                return (string)this["groupName"];
            }
            set
            {
                this["groupName"] = value;
            }
        }

        [ConfigurationProperty("processId", IsRequired = true)]
        public string ProcessId
        {
            get
            {
                return (string)this["processId"];
            }
            set
            {
                this["processId"] = value;
            }
        }

        [ConfigurationProperty("processName", IsRequired = true)]
        public string ProcessName
        {
            get
            {
                return (string)this["processName"];
            }
            set
            {
                this["processName"] = value;
            }
        }

        [ConfigurationProperty("taskType", IsRequired = true)]
        public string TaskType
        {
            get
            {
                return (string)this["taskType"];
            }
            set
            {
                this["taskType"] = value;
            }
        }

        [ConfigurationProperty("isExternalJob", IsRequired = false)]
        public bool IsExternalJob
        {
            get
            {
                return (bool)this["isExternalJob"];
            }
            set
            {
                this["isExternalJob"] = value;
            }
        }

        [ConfigurationProperty("sourcePath", IsRequired = false)]
        public string SourcePath
        {
            get
            {
                return (string)this["sourcePath"];
            }
            set
            {
                this["sourcePath"] = value;
            }
        }


        [ConfigurationProperty("destinationPath", IsRequired = false)]
        public string DestinationPath
        {
            get
            {
                return (string)this["destinationPath"];
            }
            set
            {
                this["destinationPath"] = value;
            }
        }

        [ConfigurationProperty("predecessors", IsRequired = false)]
        [ConfigurationCollection(typeof(BaseConfigurationElement), AddItemName = "add")]
        public ConfigurationCollection<BaseConfigurationElement> Predecessors
        {
            get
            {
                return (ConfigurationCollection<BaseConfigurationElement>)this["predecessors"];
            }
        }

        [ConfigurationProperty("successors", IsRequired = false)]
        [ConfigurationCollection(typeof(BaseConfigurationElement), AddItemName = "add")]
        public ConfigurationCollection<BaseConfigurationElement> Successors
        {
            get
            {
                return (ConfigurationCollection<BaseConfigurationElement>)this["successors"];
            }
        }
    }
}
